#!/usr/bin/python

# Prints the first header of a fits file
import sys
fh = open(sys.argv[1],'rb')
i = 0
while 1:
    fh.seek(i)
    line = fh.read(80)
    if line.startswith('END'):  break
    try:
        print line
    except IOError:
	break
    i += 80
fh.close()
